<header>
    <h3><?= lang('product_manage') ?> <span>- <?= lang('product_update') ?></span></h3>
</header>
<section class="welly">
    <form id="create_product" method="post"	action="" class="form-horizontal" enctype="multipart/form-data">
        <input type="hidden" name="submit" value="1"/>
        <input type="hidden" name="id" />
        <ul class="nav nav-tabs tab_styled_light">
            <li class="active"><a href="#tab1" data-toggle="tab"><?= lang('product_data') ?></a></li>
            <li><a href="#tab2" data-toggle="tab"><?= lang('product_info') ?></a></li>
            <li><a href="#tab3" data-toggle="tab"><?= lang('product_images') ?></a></li>
            <li><a href="#tab4" data-toggle="tab"><?= lang('product_catalogue') ?></a></li>
            <li><a href="#tab5" data-toggle="tab"><?= lang('product_location') ?></a></li>
            <li><a href="#tab6" data-toggle="tab"><?= lang('product_discount') ?></a></li>
        </ul>
        <div class="tab-content tab_content_light">
            <div id="tab1" class="tab-pane active">
                <div class="control-group">
                    <label class="control-label"><?= lang('product_image') ?></label>
                    <div class="controls">
                        <img src="" alt="" class="product_image"/><br />
                        <input type="file" name="image" class="input-xlarges"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"><?= lang('product_price') ?></label>
                    <div class="controls">
                        <input type="text" name="price" class="input-medium"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"><?= lang('product_sale_price') ?></label>
                    <div class="controls">
                        <input type="text" name="sale_price" class="input-medium"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"><?= lang('product_start') ?></label>
                    <div class="controls">
                        <input type="text" name="start" class="input-medium"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"><?= lang('product_end') ?></label>
                    <div class="controls">
                        <input type="text" name="end" class="input-medium"/>
                    </div>
                </div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_amount') ?></label>
					<div class="controls">
						<input type="text" name="amount" class="input-medium"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_voucher') ?></label>
					<div class="controls">
						<input type="checkbox" name="voucher" value="1" class="input-medium"/>
					</div>
				</div>
            </div>
            <div id="tab2" class="tab-pane fade">
                <ul class="nav nav-tabs tab_styled_light">
					<? foreach ($langs as $l) { ?>
	                    <li<?= $l->id == $lang ? ' class="active"' : '' ?>><a href="#tab2<?= $l->id ?>" data-toggle="tab"><?= $l->name ?></a></li>
					<? } ?>
                </ul>
                <div class="tab-content tab_content_light">
					<? foreach ($langs as $l) { ?>
	                    <div id="tab2<?= $l->id ?>" class="tab-pane<?= $l->id == $lang ? ' active' : ' fade' ?>">
	                        <div class="control-group">
	                            <label class="control-label"><?= lang('product_name') ?></label>
	                            <div class="controls">
	                                <input type="text" name="info[<?= $l->id ?>][name]" class="input-xlarge" />
	                            </div>
	                        </div>
	                        <div class="control-group">
	                            <label class="control-label"><?= lang('product_description') ?></label>
	                            <div class="controls">
	                                <textarea id ="description<?= $l->id ?>" name="info[<?= $l->id ?>][description]" class="input-xlarge" ></textarea>
									<script type="text/javascript">
										init_ckeditor('description<?= $l->id ?>')
									</script>
	                            </div>
	                        </div>
	                        <div class="control-group">
	                            <label class="control-label"><?= lang('product_advantages') ?></label>
	                            <div class="controls">
	                                <textarea id="advantages<?= $l->id ?>" name="info[<?= $l->id ?>][advantages]" class="input-xlarge" ></textarea>
									<script type="text/javascript">
										init_ckeditor('advantages<?= $l->id ?>');
									</script>
	                            </div>
	                        </div>
	                        <div class="control-group">
	                            <label class="control-label"><?= lang('product_meta_desc') ?></label>
	                            <div class="controls">
	                                <textarea name="info[<?= $l->id ?>][meta_desc]" class="input-xlarge" ></textarea>
	                            </div>
	                        </div>
	                        <div class="control-group">
	                            <label class="control-label"><?= lang('product_meta_keyword') ?></label>
	                            <div class="controls">
	                                <textarea name="info[<?= $l->id ?>][meta_keyword]" class="input-xlarge" ></textarea>
	                            </div>
	                        </div>
	                    </div>
					<? } ?>
                </div>
            </div>
            <div id="tab3" class="tab-pane fade">
                <div class="control-group">
                    <label class="control-label" for="images"><?= lang('product_images') ?></label>
                    <div id="images" class="controls">
                        <div>
                            <input type="file" name="images_0" class="input-xlarges"/>
                            <input type="button" class="btn btn-info" id="add_image" value="<?= lang('product_add_image') ?>" />
                        </div>
                    </div>
                </div>
                <ul id="basicGallery" class="gallery_basic">

                </ul>
            </div>
            <div id="tab4" class="tab-pane fade">
                <label class="checkbox"><input type="checkbox" id="tab4_check"><b><?= lang('select_all') ?></b></label>
				<? foreach ($catalogues as $catalogue) { ?>
	                <label class="checkbox"><input type="checkbox" name="catalogues[]" value="<?= $catalogue->id ?>" /><?= $catalogue->pre ?><?= $catalogue->name ?></label>
				<? } ?>
            </div>
            <div id="tab5" class="tab-pane fade">
                <label class="checkbox"><input type="checkbox" id="tab5_check"><b><?= lang('select_all') ?></b></label>
				<? foreach ($locations as $location) { ?>
	                <label class="checkbox"><input type="checkbox" name="locations[]" value="<?= $location->id ?>" /><?= $location->pre ?><?= $location->name ?></label>
				<? } ?>
            </div>
            <div id="tab6" class="tab-pane fade">

            </div>
        </div>
        <hr>
        <div>
            <input type="submit" class="btn btn-success" value="<?= lang('ok') ?>" />
            <button class="btn"><?= lang('cancel') ?></button>
        </div>
    </form>
</section>